package com.jackrain.nea.wms.web.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.alibaba.fastjson.JSONObject;
import com.jackrain.nea.core.schema.TableImpl;
import com.jackrain.nea.web.ExportCmd;
import com.jackrain.nea.web.common.AjaxUtils;
import com.jackrain.nea.web.query.QueryRequest;
import com.jackrain.nea.web.query.QuerySession;
import com.jackrain.nea.web.service.ExportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Locale;

@Slf4j
@Component("ExportCmdImpl-wms")
@Service(protocol="dubbo", validation="true", version="100", group= "wms")
public class ExportCmdImpl implements ExportCmd {

    @Autowired
    private ExportService exportService;

    public JSONObject getData(QueryRequest query) throws Exception {
       return exportService.getData(query);
    }

    public QueryRequest parseQuery(JSONObject jo, QuerySession session, int userId, Locale locale, TableImpl table) throws Exception {
        return  AjaxUtils.parseQuery(jo, session, userId, locale,table);
    }
}
